﻿Imports AccesoDatos

Public Class CatalogoMozo
    Public Function ValidarMozo(ByVal pstrUsuario As String, ByVal pstrClave As String, ByVal pstrLocal As String) As DataSet

        Dim dsConsultaDatos As DataSet
        Dim objCom As New BaseDatos
        Dim Parametros(,) As Object = {{"@USUARIO", SqlDbType.VarChar, UCase(pstrUsuario)}, _
                                        {"@CLAVE", SqlDbType.VarChar, UCase(pstrClave)}, _
                                        {"@LOCAL", SqlDbType.VarChar, UCase(pstrLocal)}}
        dsConsultaDatos = objCom.ExecSPDataSetCP("SP_MOZO_Login", Parametros)

        Return dsConsultaDatos
    End Function

    Public Function ListaCarta(ByVal pstrLocal As String) As DataSet

        Dim dsConsultaDatos As DataSet
        Dim objCom As New BaseDatos
        Dim Parametros(,) As Object = {{"@LOCAL", SqlDbType.VarChar, UCase(pstrLocal)}}
        dsConsultaDatos = objCom.ExecSPDataSetCP("SP_BANDEJA_CARTA", Parametros)

        Return dsConsultaDatos
    End Function

    Public Function MesasOcupadas(ByVal pstrLocal As String) As DataSet
        Dim dsConsultaDatos As DataSet
        Dim objCom As New BaseDatos
        Dim Parametros(,) As Object = {{"@LOCAL", SqlDbType.VarChar, UCase(pstrLocal)}}
        dsConsultaDatos = objCom.ExecSPDataSetCP("SP_BANDEJA_MESAS_OCUPADAS", Parametros)
        Return dsConsultaDatos
    End Function

    Public Function BuscaPedido(ByVal pstrLocal As String, ByVal pstrMesa As String) As DataSet
        Dim dsConsultaDatos As DataSet
        Dim objCom As New BaseDatos
        Dim Parametros(,) As Object = {{"@LOCAL", SqlDbType.VarChar, UCase(pstrLocal)}, _
                                        {"@MESA", SqlDbType.VarChar, UCase(pstrMesa)}}
        dsConsultaDatos = objCom.ExecSPDataSetCP("SP_BUSCA_PEDIDOSxMESA", Parametros)
        Return dsConsultaDatos
    End Function

    Public Function CreaPedido(ByVal pstrLocal As String, ByVal pstrMesa As String, ByVal pstrUsuario As String) As Integer
        Dim dsResultado As Integer
        Dim objCom As New BaseDatos
        Dim Parametros(,) As Object = {{"@LOCAL", SqlDbType.VarChar, UCase(pstrLocal)}, _
                                      {"@MESA", SqlDbType.VarChar, UCase(pstrMesa)}, _
                                      {"@USUARIO", SqlDbType.VarChar, UCase(pstrUsuario)}}
        dsResultado = objCom.ExecSPIntegerCP("SP_INSERTA_PEDIDO", Parametros)
        Return dsResultado
    End Function

    Public Function DetallePedido(ByVal pstrID As String, ByVal pstrLocal As String) As DataSet
        Dim dsConsultaDatos As DataSet
        Dim objCom As New BaseDatos
        Dim Parametros(,) As Object = {{"@ID", SqlDbType.VarChar, UCase(pstrID)}, _
                                      {"@LOCAL", SqlDbType.VarChar, UCase(pstrLocal)}}
        dsConsultaDatos = objCom.ExecSPDataSetCP("SP_DETALLE_PEDIDO", Parametros)
        Return dsConsultaDatos
    End Function

    Public Function DetallePedidoTicket(ByVal pstrID As String, ByVal pstrLocal As String) As DataSet
        Dim dsConsultaDatos As DataSet
        Dim objCom As New BaseDatos
        Dim Parametros(,) As Object = {{"@ID", SqlDbType.VarChar, UCase(pstrID)}, _
                                      {"@LOCAL", SqlDbType.VarChar, UCase(pstrLocal)}}
        dsConsultaDatos = objCom.ExecSPDataSetCP("SP_DETALLE_PEDIDO_TICKET", Parametros)
        Return dsConsultaDatos
    End Function

    Public Function AgregaProducto(ByVal pstrLocal As String, ByVal pstrPedido As String, ByVal pstrProducto As String, ByVal pstrUsuario As String) As Integer
        Dim dsResultado As Integer
        Dim objCom As New BaseDatos
        Dim Parametros(,) As Object = {{"@LOCAL", SqlDbType.VarChar, UCase(pstrLocal)}, _
                                      {"@PEDIDO", SqlDbType.VarChar, UCase(pstrPedido)}, _
                                      {"@PRODUCTO", SqlDbType.VarChar, UCase(pstrProducto)}, _
                                      {"@USUARIO", SqlDbType.VarChar, UCase(pstrUsuario)}}
        dsResultado = objCom.ExecSPIntegerCP("SP_INSERTA_PRODUCTOxPEDIDO", Parametros)
        Return dsResultado
    End Function

    Public Function AgregaProductoNew(ByVal pstrLocal As String, ByVal pstrPedido As String, ByVal pstrCadProducto As String, ByVal pstrUsuario As String) As Integer
        Dim dsResultado As Integer
        Dim objCom As New BaseDatos
        Dim Parametros(,) As Object = {{"@LOCAL", SqlDbType.VarChar, UCase(pstrLocal)}, _
                                      {"@PEDIDO", SqlDbType.VarChar, UCase(pstrPedido)}, _
                                      {"@CADPRODUCTO", SqlDbType.VarChar, UCase(pstrCadProducto)}, _
                                      {"@USUARIO", SqlDbType.VarChar, UCase(pstrUsuario)}}
        dsResultado = objCom.ExecSPIntegerCP("SP_INSERTA_PRODUCTOxPEDIDO_New", Parametros)
        Return dsResultado
    End Function



    Public Function AgregaProductoEspecial(ByVal pstrLocal As String, ByVal pstrPedido As String, ByVal pstrProducto As String, ByVal pstrCantidad As String, ByVal pstrCosto As String, ByVal pstrUsuario As String) As Integer
        Dim dsResultado As Integer
        Dim objCom As New BaseDatos
        Dim Parametros(,) As Object = {{"@LOCAL", SqlDbType.VarChar, UCase(pstrLocal)}, _
                                      {"@PEDIDO", SqlDbType.VarChar, UCase(pstrPedido)}, _
                                      {"@PRODUCTO", SqlDbType.VarChar, UCase(pstrProducto)}, _
                                      {"@CANTIDAD", SqlDbType.VarChar, UCase(pstrCantidad)}, _
                                      {"@COSTO", SqlDbType.VarChar, UCase(pstrCosto)}, _
                                      {"@USUARIO", SqlDbType.VarChar, UCase(pstrUsuario)}}
        dsResultado = objCom.ExecSPIntegerCP("SP_INSERTA_PRODUCTOxPEDIDOESPECIAL", Parametros)
        Return dsResultado
    End Function


    Public Function QuitaProducto(ByVal pstrLocal As String, ByVal pstrPedido As String, ByVal pstrProducto As String) As Integer
        Dim dsResultado As Integer
        Dim objCom As New BaseDatos
        Dim Parametros(,) As Object = {{"@ID", SqlDbType.VarChar, UCase(pstrPedido)}, _
                                      {"@LOCAL", SqlDbType.VarChar, UCase(pstrLocal)}, _
                                      {"@PROD", SqlDbType.VarChar, UCase(pstrProducto)}}
        dsResultado = objCom.ExecSPIntegerCP("SP_ELIMINA_PRODUCTOxPEDIDO", Parametros)
        Return dsResultado
    End Function




End Class
